<template>
  <div>
    <div>{{count}}</div>
    <button class="btn-small btn-primary" @click="addNum(1)">加</button>
    <button class="btn-small btn-primary" @click="reduceNum(5)">减</button>
    <ul>
      <li v-for="(v,k) in doneProList">{{v.name}}--{{v.price}}</li>
    </ul>
  </div>
</template>

<script>
  import {mapState,mapGetters,mapMutations,mapActions} from 'vuex'
  export default {
    name: "vueStore",
    data(){
      return {

      }
    },
    computed:{
      ...mapState({
        // count: state => state.count,
        count: 'count',
      }),
      ...mapGetters({
        doneProList: 'doneProList'
      })
    },
    methods:{
      ...mapMutations({
        addNum:'COUNT_ADD',
      }),
      ...mapActions({
        reduceNum:'reduceAsync'
      }),
    }

  }
</script>

<style scoped>

</style>
